<?php $form = $this->getFormObject() ?>
[?php $<?php echo $this->getSingularName() ?> = $form->getObject() ?]
<div class="form-wrapper">
    <h1>[?php echo $<?php echo $this->getSingularName() ?>->isNew() ? __('New') : __('Edit') ?] 
        <?php echo sfInflector::humanize($this->getModuleName()) ?>
    </h1>
    <p>
    </p>
    <form action="[?php echo url_for('<?php echo $this->getModuleName() ?>/<?php echo isset($this->params['non_atomic_actions']) && $this->params['non_atomic_actions'] ? 'edit' : 'update' ?>'.(!$<?php echo $this->getSingularName() ?>->isNew() ? '?<?php echo $this->getPrimaryKeyUrlParams() ?> : '')) ?]" method="post" [?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?]>
        <?php if (isset($this->params['non_verbose_templates']) && $this->params['non_verbose_templates']): ?>
        [?php echo $form ?]
        <?php else: ?>
        [?php echo $form->renderGlobalErrors() ?]
        <?php foreach ($form->getWidgetSchema()->getPositions() as $i => $name): ?>
        <?php if ($form[$name]->isHidden()) continue ?>
            <?php echo $form[$name]->renderLabel() ?>
            [?php echo $form['<?php echo $name ?>']->render(array('class'=> ($form['<?php echo $name ?>']->hasError() ? __('error'):'') )) ?]
            <div class="spacer"></div>
            <?php $i == $this->getLastNonHiddenField() and print $this->getHiddenFieldsAsString() ?>
        <?php endforeach; ?>
        <?php endif; ?>
        <button type="submit">
            <?php echo 'Submit';?>
        </button>
        <div class="spacer"></div>
        <a href="[?php echo url_for('<?php echo $this->getModuleName() ?>/index') ?]">[?php echo __('Cancel'); ?]</a>
        [?php if (!$<?php echo $this->getSingularName() ?>->isNew()): ?]
        &nbsp;[?php echo link_to(__('Delete'), '<?php echo $this->getModuleName() ?>/delete?<?php echo $this->getPrimaryKeyUrlParams() ?> , array('post' => true, 'confirm' => __('Are you sure ?'))) ?]
        [?php endif; ?]
    </form>
</div>